Write for people first.
Keep important prompts in minimally intrusive Markdown files. Review changes and evolve behavior without burying the prose.
Readable, reusable, and composable prompts
WeaveMark is a small, Markdown-native specification language for prompts: you specify abstract intent and the LLM-based processor makes it concrete (either by compilation or dynamic interpretation). The readable, reusable units you write in it are called promplets: each can stand alone or be built from other promplets. Great for both humans and AI agents.
pip install weavemark
weavemark library market-snapshot --replay --verbose --open
Restores the saved market run and opens its final HTML dashboard. How replay works
What it gives you
A promplet is readable Markdown before compilation and a concrete artifact afterward. Shared guidance stays in modules instead of spreading through copied prompts.
Keep important prompts in minimally intrusive Markdown files. Review changes and evolve behavior without burying the prose.
Refine shared methods and constraints, then branch with
@if or @match for controlled variations.
Review the compiled result and its contract, then use it as a prompt, specification, emitted file, or executable workflow.
Semantic composition
A model decides how reusable guidance belongs in the local document; deterministic structure keeps variables, branches, and contracts explicit.
Worked example
The source stays compact, while the compiled prompt gains the reusable decision structure in the right places.
# Decision brief refinement
Lead with the decision pressure.
Separate facts, assumptions, and judgment.
Include counter-evidence and reversal triggers.
@output enforce: strict
Return decision, evidence, and next action.
@refine module:weavemark.std.lenses.decision_gate mingle: true
# Launch gate
Ship @{release} to
@{segment} this week?
Use @{validation_log} and @{open_risks}.
@if executive_audience
Compress into board-ready language.
# Launch gate
Ship Aurora 1.0 to beta teams this week?
Lead with the decision pressure: ship,
wait, or narrow the rollout.
Use the validation log and open risks. Separate
facts, assumptions, and judgment.
Include counter-evidence and reversal triggers.
Give the smallest safe next action in board-ready language.
Language moves
Each directive does one visible job while the source continues to read as a document.
@refine
Weave reusable guidance into local intent.
@refine module:weavemark.std.analysis.mece_core
@if
Keep controlled variations in one source.
@if executive_audience
Compress into board-ready language.
@ask
Pause for human context before compiling.
@ask clarifying question detail_level: 35%
Teach @{topic} to this learner.
@iterate
Judge and improve a transformation.
@iterate 3
@expand mode: intention
Draft the onboarding prompt.
@assert
Make output obligations explicit.
@assert contains: "open questions"
@execute
Choose how the compiled prompt runs.
@execute reflection
max_rounds: 3
Batteries included
Ninety reusable fragments ship with WeaveMark. Refine one into your source and its method comes with it.
“I have to make a hard call and I keep going in circles.”
“I want an app built, but my spec is three vague sentences.”
“The answer sounds confident. Should I believe it?”
“I need ideas that aren't the first three obvious ones.”
“I have to teach this, and they keep getting it wrong.”
“This pile of notes has to become something readable.”
Outcomes
Compile a prompt, prepare a software specification, or run a tool-grounded workflow.
Turn contradictory source prompts into coherent reusable instructions.
Compile concise product intent into an implementation-ready specification for a coding agent.
Search, deduplicate, and remember, then resurface only material changes.
Start here
Start with one promplet, then use the tutorial, API, or reference only when you need more.
Create a promplet from a blank page: add variables, borrow reusable constraints, branch, and lock the output shape.
Build your first promplet80-second walkthrough
Take a quick tour from readable promplet source to compilation, execution, and finished artifacts.
YouTube loads only after you press play. If the embedded player is blocked, watch the full-resolution video on YouTube.
Live results
Open a result, then inspect the source, compiled artifact, or trace that produced it.
A twelve-page picture book authored, illustrated page by page, and packaged to HTML/PDF by one executable promplet.
A concise browser-app promplet became a complete static JavaScript workspace backed by a user-selected SQLite file.
Finance data and bounded web-search evidence flow through a validated graph into an auditable report and standalone dashboard.
A 55-card archetypal reflection game generated in two stages: deck artifacts, then a private browser reading experience.